﻿@namespace Aspire.Dashboard.Components

@using Aspire.Dashboard.Extensions
@using Aspire.Dashboard.Otlp.Model
@using Aspire.Dashboard.Resources
@using Aspire.Dashboard.Utils

@inject IStringLocalizer<StructuredLogs> Loc

<GridValue Value="@FormatHelpers.TruncateText(LogEntry.Message, FormatHelpers.ColumnMaximumTextLength)"
           ValueToVisualize="@LogEntry.Message"
           ValueDescription="@Loc[nameof(StructuredLogs.StructuredLogsMessageColumnHeader)]"
           ToolTip="@FormatHelpers.TruncateText(LogEntry.Message, FormatHelpers.TooltipMaximumTextLength)"
           EnableHighlighting="true"
           HighlightText="@FilterText"
           StopClickPropagation="true">
    <ContentInButtonArea>
        <ExceptionDetails ExceptionText="@_exceptionText" />
    </ContentInButtonArea>
</GridValue>

@code {
    [Parameter, EditorRequired]
    public required OtlpLogEntry LogEntry { get; set; }

    [Parameter, EditorRequired]
    public required string FilterText { get; set; }
}
